<template>
  <div class="artItem" @click="clickItem({id:itemObj.id,cid:itemObj.classid,type:'list'})">
    <div class="pic">
      <img :src="itemObj.picurl" alt="">
    </div>
    <div class="text">
       <div class="title">{{itemObj.title}}</div>
       <div class="info">
         <div class="tiem">
           <i class="iconfont icon-clock"></i>
           {{myDate(itemObj.posttime)}}
           </div>
         <div class="hits">
           <i class="iconfont icon-browse"></i>
           {{getNum(itemObj.hits)}}
           </div>
       </div>
    </div>
  </div>
</template>

<script>
import common from '@/assets/js/common.js'
export default {
  props: {
    itemObj: {
      type: Object,
      default: () => {}
    }
  },
  methods: {
    getNum (num) {
      return common.getNum(num)
    },
    myDate (time) {
      return common.myDate(time, 1)
    },
    clickItem (obj) {
      this.$router.push({ path: '/detail', query: obj })
    }
  }
}
</script>

<style lang="less" scoped>
.artItem{
  border: 1px solid #67C23A;
  display: flex;
  height: 1.6rem;
  margin-bottom: 0.2rem;
  .pic{
    width: 35%;
    img{
      width: 100%;
      height: 100%;
    }
  }
  .text{
    width: 65%;
    padding: 0.1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.26rem;
    .title{
      font-size: .28rem;
      font-weight: 700;
    }
    .info{
      display: flex;
      justify-content: space-between;
      color: #888;
    }
  }
}
</style>
